﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OpenOrdersInventoryReport.aspx.cs" Inherits="MLY.Reports.DataReports.OpenOrdersInventoryReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title><asp:Literal ID="TitleLiteral" runat="server" Text="<%$ Dict:reportsParams.InventoryReport %>"></asp:Literal></title>
    <link href="/Style/General_Style_v9.css" rel="stylesheet" type="text/css" />
    <link href="../../Style/ReportsStylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="InerTextStyle">
        <asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager>
        <asp:Panel ID="DirectionPanel" runat="server">
        <asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>        
            <asp:HiddenField ID="UserRoleHiddenField" runat="server" />
            <asp:Panel ID="DemoPanel" runat="server">
                <div class="democlass">
                    The open orders/inventory report is pretty simple -  
                    all you have to do is choose from the combo box the organization that relevant for you and 
                    then you can see all his open ordes/ inventory. 
                </div>
            </asp:Panel>
            <asp:Label ID="PageTitleLabel" runat="server" Text="<%$ Dict:reportsParams.InventoryReport %>" CssClass="TitleStyle"></asp:Label>
            <br />
            <asp:Panel ID="ReportDefinitionsPanel" runat="server">
            <table cellpadding="5" cellspacing="0">
            <tr>
            <td>
                <asp:Label ID="OrganizationTitleLabel" Text='<%$Dict:reportsParams.ChooseOrganization: %>' runat="server"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddlOrgs" runat="server" DataTextField="OrganizationName"
                    DataValueField="OrganizationId" OnLoad="ddlOrgs_Load">
                </asp:DropDownList>
            </td>
            </tr>
            <tr>
            <td>
            <asp:Button ID="GenerateReportButton" runat="server" Text="<%$ Dict:Reports.GenerateReport %>" OnClick="GenerateReport" />  
            </td>
            <td colspan="3">                
                <asp:UpdateProgress ID="Progress" runat="server" AssociatedUpdatePanelID="UpdatePanel">
                    <ProgressTemplate>
                        <asp:Image ID="ProgressImage" runat="server" ImageUrl="~/Images/ajax-loaderBar.gif" />
                    </ProgressTemplate>
                </asp:UpdateProgress>          
            </td>
            </tr>
            </table>
            <br />
            </asp:Panel>
            <asp:Panel ID="ReportTablesPanel" runat="server" Visible="false">
                <br /><hr /><br />
                <table cellspacing="5" cellpadding="0">
                <tr>
                <td style="vertical-align:top; padding: 0px 10px 0px 10px;">
                    <asp:Panel ID="OrgListPanel" runat="server">
                        <asp:Repeater ID="ReportOrganizationsAnchorsRepeater" runat="server">
                        <ItemTemplate>
                            - 
                            <asp:HyperLink ID="OrgAnchorlink" runat="server" NavigateUrl='<%# "#" + Eval("OrganizationId") %>'
                             Text='<%# Eval("OrganizationName") %>'></asp:HyperLink>
                        </ItemTemplate>
                        <SeparatorTemplate><br /><br /></SeparatorTemplate>
                        </asp:Repeater>
                    </asp:Panel>
                </td>
                <td>
                    <asp:Repeater ID="FullReportRepeater" runat="server" OnItemDataBound="OnFullRepeaterItemCreated">
                    <ItemTemplate>
                        <asp:HiddenField ID="OrganizationIdHiddenField" runat="server" Value='<%# Eval("OrganizationId") %>' />
                        <a name='<%# Eval("OrganizationId") %>'></a>
                        <asp:Label ID="OrganizationNameLabel" runat="server" Text='<%# Eval("OrganizationName") %>' CssClass="TitleStyle"></asp:Label>
                        <asp:GridView ID="ActualReportGridview" runat="server" AutoGenerateColumns="false" CellPadding="5">
                            <HeaderStyle CssClass="GridTitleStyle" />
                            <Columns>
                                <asp:BoundField DataField="OrderNumber" HeaderText="<%$ Dict:clientAddWo.OrderNumber %>" />
                                <asp:BoundField DataField="ContractorWorkOrderNumber" HeaderText="<%$ Dict:clientAddWo.ContractorWorkOrderNumber %>" />
                                <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="<%$ Dict:clientAddWo.CustomerWorkOrderNumber %>" />
                                <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="<%$ Dict:clientAddWo.CustomerCatalougeCode %>" />
                                <asp:BoundField DataField="ContractorCatalogueCode" HeaderText="<%$ Dict:clientAddWo.ContractorCatalougeCode %>" />
                                <asp:TemplateField HeaderText="<%$ Dict:clientAddWo.SendDate %>" >
                                <ItemTemplate>
                                    <%# FormatDate(Eval("SendDate")) %>
                                </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Quantity" HeaderText="<%$ Dict:clientAddWo.Quantity %>" />
                                <asp:BoundField DataField="ProductDescription" HeaderText="<%$ Dict:clientAddWo.ProductDescription %>" />
                                <asp:BoundField DataField="TextFieldA" HeaderText="<%$ Dict:clientAddWo.TextFieldA %>" />
                                <asp:BoundField DataField="TextFieldB" HeaderText="<%$ Dict:clientAddWo.TextFieldB %>" />
                                <asp:BoundField DataField="Remarks" HeaderText="<%$ Dict:clientAddWo.Remarks %>" />                               
                                
                            </Columns>
                            <EmptyDataTemplate><asp:Literal runat="server" ID="NoLines" Text="<%$ Dict:SubContractors.lblNoMessages %>"></asp:Literal> </EmptyDataTemplate>
                        </asp:GridView>
                         
                    </ItemTemplate>
                    <SeparatorTemplate><br /></SeparatorTemplate>
                    </asp:Repeater>
                </td>
                </tr>
                </table>
                
                
            </asp:Panel>
            
            
        </ContentTemplate>   
        </asp:UpdatePanel>       
        </asp:Panel>
        
    </div>
    </form>
</body>
</html>
